package com.gopay.common.dss.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * Created by zhaojt on 2017/7/28.
 */
@Component
@Lazy
public class DssConfig {

    /**
     * zookeeper 分布式锁服务集群
     */
    @Value("#{webProperties['zk.lock.connectionstr']}")
    private String zkLockConnectionStr ;

    /**
     * zookeeper分布式锁服务 重试时间间隔
     * @param baseSleepTimeMs initial amount of time to wait between retries
     */
    @Value("#{webProperties['zk.lock.basesleeptimems']}")
    private int zkLockBasesleeptimems = 100;  //默认100毫秒

    /**
     * zookeeper分布式锁服务 最大重试次数
     * @param maxRetries max number of times to retry
     */
    @Value("#{webProperties['zk.lock.maxretries']}")
    private int zkLockMaxretries = 1;         //默认1次

    public String getZkLockConnectionStr() {
        return zkLockConnectionStr;
    }

    public void setZkLockConnectionStr(String zkLockConnectionStr) {
        this.zkLockConnectionStr = zkLockConnectionStr;
    }

    public int getZkLockBasesleeptimems() {
        return zkLockBasesleeptimems;
    }

    public void setZkLockBasesleeptimems(int zkLockBasesleeptimems) {
        this.zkLockBasesleeptimems = zkLockBasesleeptimems;
    }

    public int getZkLockMaxretries() {
        return zkLockMaxretries;
    }

    public void setZkLockMaxretries(int zkLockMaxretries) {
        this.zkLockMaxretries = zkLockMaxretries;
    }
}
